<div id="app">
  全局组件在任何组件内都能使用
  <component-a></component-a>
  <component-b></component-b>
</div>
<script src="https://unpkg.com/vue@next"></script>
<script>
  const app = Vue.createApp({})
  app.component('component-a', {
    template: `
      <div>a</div>
      <component-b></component-b>
    `
  })
  app.component('ComponentB', {
    template: `<div>b</div>`
  })
  app.mount('#app')
</script>